/*
 * Digital Audio Mobile - A multi track studio for Windows Mobile
 * Copyright (C) 2008 David Olsson
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

#if !defined(__SETTINGSDIALOG_H__)
#define __SETTINGSDIALOG_H__

#include <windows.h>

#include "DeviceFactory.h"
#include "Dialog.h"
#include "MusicTime.h"

class InputDevice;

class SettingsDialog: public Dialog {
public:
    struct Settings {
        InputDevice *inDev;
        OutputDevice *outDev;
        MusicTime latency;
        bool metPlayback;
        bool metRecording;
    };

    SettingsDialog(HINSTANCE hInstance) throw();
    virtual ~SettingsDialog();

    bool hasSettings() const throw();

    Settings currentSettings() throw();
private:
    bool readSettings() throw();
    void writeSettings() throw();

    void showAudioSetup(bool show) throw();
    void showMetronome(bool show) throw();

    virtual bool close(CloseCommand cc) throw();
    virtual void controlNotification(HWND hWnd, WPARAM notification) throw();
    virtual void menuNotification(unsigned int itemId) throw();

    DeviceFactory m_devFac;

    DWORD m_inputDevice, m_outputDevice;
    DWORD m_latency;
    DWORD m_metPlayback, m_metRecording;
    bool m_hasSettings;

    HWND m_hTabs;
    HWND m_hBackground;

    HWND m_hInputDevLabel, m_hInputDev;
    HWND m_hOutputDevLabel, m_hOutputDev;
    HWND m_hLatencyLabel, m_hLatency;

    HWND m_hPlayback;
    HWND m_hRecording;
};

#endif
